/**
 * @program: LoveDataStructures1
 * @description: [用一句话描述此类]
 * @author: wxc
 * @create: 2021-07-25 09:29
 **/
public class Person implements Comparable<Person> {
    private int age;
    private String name;

    public Person(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "age=" + age;
    }


    @Override
    public int compareTo(Person o) {
        return this.age - o.age;
    }
}
